home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / archie38_1.lha / archie-1.4 / amiga / getpid.c next >
C/C++ Source or Header  |  1995-01-05  |  1KB  |  53 lines

  1. /* This is my little routine to trick up the AmiTCP uid.
  2.  * Why this isn't a standar funciton, I don't know.  I probably
  3.  * missed something in the docs. --tcw
  4.  */
  5. /* Amiga-specific, duh. */
  6. /* Amiga port by Tomas Willis (tomas@cae.wisc.edu) January 1995 */
  7.  
  8. #ifdef AMIGA
  9.  
  10. #include <sys/types.h>
  11. #include <exec/types.h>
  12. #include <exec/tasks.h>
  13. #include <clib/exec_protos.h>
  14. #include <pragmas/exec_pragmas.h>
  15.  
  16. //protos
  17. pid_t getpid(void);
  18.  
  19.  
  20. pid_t getpid(void)
  21. {
  22.   return (pid_t)FindTask((UBYTE *)0);
  23. }
  24.  
  25. #endif /* AMIGA */
  26.  
  27. #if 0
  28.  
  29. GETPID(2V)                SYSTEM CALLS                 GETPID(2V)
  30.  
  31. NAME
  32.      getpid, getppid - get process identification
  33.  
  34. SYNOPSIS
  35.      #include <sys/types.h>
  36.  
  37.      pid_t getpid()
  38.  
  39.      pid_t getppid()
  40.  
  41. DESCRIPTION
  42.      getpid() returns the process  ID  of  the  current  process.
  43.      Most  often  it is used to generate uniquely-named temporary
  44.      files.
  45.  
  46.      getppid() returns the  process  ID  of  the  parent  of  the
  47.      current process.
  48.  
  49. SEE ALSO
  50.      gethostid(2)
  51.  
  52. #endif
  53.